import Vue from 'vue'
import Router from 'vue-router'
// 路由懒加载后不需要引入
import Callback from '../components/oidc/Callback'
// import list from '../components/oidc/list'
// import welcome from '../components/welcome'
// import userlist from '../components/userlist'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: '/HelloWorld',
        },
        {
            path: '/HelloWorld',
            name: 'HelloWorld',
            // 路由懒加载：
            component: resolve => require(['../components/oidc/Helloworld'], resolve),
        },
        {
            path: '/Callback',
            name: 'Callback',
            // component: resolve => require(['../components/oidc/Callback'], resolve),
            component: Callback,
        },
        {
            path: '/list',
            name: 'list',
            component: resolve => require(['../components/oidc/List'], resolve),
            redirect:"/organization",
            children:[
                // {
                //     path:"/welcome",
                //     component: resolve => require(['../components/oidc/list/Welcome'], resolve),
                //     // component:welcome,
                // },
                {
                    path:"/organization",
                    component: resolve => require(['../components/oidc/list/Organization/Organization'], resolve),
                },
                {
                    path:"/role",
                    component: resolve => require(['../components/oidc/list/Role/Role'], resolve),
                },
                {
                    path:"/relation",
                    component: resolve => require(['../components/oidc/list/Relation/Relation'], resolve),
                },
            ]
        },
    ]
})